package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.StockOutDeliveryDto;
import com.dingreading.cloud.admin.entity.WhStockOut;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface WhStockOutService extends IService<WhStockOut> {

    Page<WhStockOut> pageList(PageUtil pageUtil, String keyword, Integer status, Integer stockOutMethod);

    WhStockOut getByOutCode(String outCode);

    List<StockOutDeliveryDto> deliveryListByCodes(List<String> outCodes);

    boolean ok(Long id);

    boolean cancel(String outCode, String staffUid, String staffName);

    List<WhStockOut> getByOrderCodeAndStockOutMethod(String orderCode, Integer stockOutMethod);

    List<WhStockOut> getByOrderCodesAndStockOutMethod(List<String> orderCode, Integer stockOutMethod);

    // 按商城订单号查询出库保存中的记录数量
    long getSaveOutCnt(String orderCode);

    // 按商城订单号查询出库完成的记录数量
    long getOkOutCnt(String orderCode);

    int dropByOutCode(String outCode);

    boolean updateGoodsTypeNumAndNum(String outCode, Integer goodsTypeNum, Integer num);

    // 获取发货完成的出库单
    List<WhStockOut> getByOrderCodeV2(String orderCode);

    // 按商城订单号删除出库保存中的记录
    int dropSaveOuts(String orderCode);


}
